{{define "Title"}}增加工单{{end}}
{{define "Content"}}

<script type=text/javascript src="/js/enterKey.js"></script>

<div class="container-fluid">
<form class="form-horizontal" action="/addwo" method="POST">
  <fieldset>
    <legend><b>增加工单</b></legend>
    {{if .error}}<div class="alert alert-error"><b>错误: </b>{{.error | html}}</div>
    {{else }}
      {{if .flash}}<div class="alert alert-success"><b>提示: </b>{{.flash | html}}</div>{{end}}
    {{end}}
    <div class="control-group">
      <label class="control-label">工单&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="wono" name="wono" style="text-transform:uppercase; background-color: #FFFFD0;" onkeydown="clicka();" maxlength="30"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">类型&nbsp;</label>
      <div class="control">
        <select id="wotype" name="wotype" style="background-color: #FFFFD0" onkeydown="clicka();" onmousewheel="return false"> 
          <option>PRODUCTION</option>
          <option>CONTROL-RUN</option>
          <option>REWORK</option>
          <option>RMA</option>
          <option>NPI</option>
          <option>EXTENDED-RETEST</option>
        </select> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">物料&nbsp;</label>
      <div class="control">
        <select id="item" name="item" style="background-color: #FFFFD0" onkeydown="clicka();" onmousewheel="return false">
          <option value="">
          {{range .items}}
            <option value="{{.Item | html}}">{{.Item | html}}  |  {{.Desc | html}}
          {{end}} 
        </select> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">版本&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="rev" name="rev" style="background-color:#FFFFD0;" onkeydown="clicka();" maxlength="10"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">制程&nbsp;</label>
      <div class="control">
        <select id="rout" name="rout" onkeydown="clicka();" onmousewheel="return false">
          <option value="">
          {{range .routings}}
            <option value="{{.Name | html}}">{{.Name | html}}
          {{end}}
        </select>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">数量&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="qty" name="qty" style="background-color:#FFFFD0;" onkeydown="clicka();"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
    {{if eq .ProductionLine "SFPRD06"}}
      <label class="control-label">批次&nbsp;</label>
    {{else}}
      <label class="control-label">备注&nbsp;</label>
    {{end}}
      <div class="control">
        <input type="text" class="input-large" id="remk" name="remk" maxlength="100">
      </div>
    </div>
    <div class="form-actions">
      <button type="submit" class="btn btn-primary">创建工单</button>
    </div>
  </fieldset>
</form>
</div>
  
{{end}}